<div id="editProjModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="editProjModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <form onsubmit="onSubmitProj($('#editProjModal'));event.preventDefault();return false;">
        <div class="modal-header"><h4 class="modal-title">修改项目信息</h4></div>
        <div class="modal-body">
          <div class="row">
            <h4 class="col-sm-2 control-label">编码</h4>
            <div class="col-sm-10">
              <input type="text" class="form-control" name="p-code"
                     value="{{proj['code']}}" maxlength="8"
                     pattern="[A-Za-z][A-Za-z0-9_]+" placeholder="3~8个字母或数字，字母开头，可含_"
                     oninvalid="setCustomValidity('请输入3~8个字母或数字，字母开头，可含_')">
            </div>
          </div>
          <div class="row">
            <h4 class="col-sm-2 control-label">名称</h4>
            <div class="col-sm-10">
              <input type="text" class="form-control" name="p-name" required value="{{proj['name']}}"
                     minlength="2" maxlength="20" placeholder="2~20字，可有汉字、字母、数字、标点">
            </div>
          </div>
          <div class="row">
            <h4 class="col-sm-2 control-label">备注</h4>
            <div class="col-sm-10">
              <textarea class="form-control" name="p-comment" maxlength="60">{{proj['comment']}}</textarea>
            </div>
          </div>
          <div class="row">
            <h4 class="col-sm-2 control-label">公开</h4>
            <div class="col-sm-10">
              {% module BoolGroup('public', proj) %}
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="submit" class="btn btn-primary modal-confirm">确定</button>
        </div>
      </form>
    </div>
  </div>
</div>

<div id="importProjModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="importProjModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <form enctype="multipart/form-data" onsubmit="importProj($('#importProjModal'));event.preventDefault();return false;">
        <div class="modal-header"><h4 class="modal-title">项目导入 <small>{{proj['code']}}</small></h4></div>
        <div class="modal-body">
          选择之前导出的项目文件 (*.zdb)
          <input type="file" class="form-control" name="zip" accept=".zdb" style="padding:4px 4px">
        </div>
        <div class="modal-footer no-border">
          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
          <button type="submit" class="btn btn-primary modal-confirm">确定</button>
        </div>
      </form>
    </div>
  </div>
</div>